var appEvent = require('../appEvent');
var ActionTypes = require('../constants').EventTypes;

/**
 * 触发发送消息事件
 * @param message
 */
module.exports.sendMessage = function (message) {
  appEvent.fire(ActionTypes.SEND_MESSAGE, message);
};

module.exports.changeConnectionStatus = function (status) {
  appEvent.fire(ActionTypes.CONNECTION_STATUS_CHANGED, status);
};

/**
 * 触发接收消息事件
 * @param message
 */
module.exports.receivedMessage = function (message) {
  appEvent.fire(ActionTypes.RECEIVED_MESSAGE, message);
};

/**
 * 触发系统通知事件
 * @param notification
 */
module.exports.receivedNotification = function (notification) {
  appEvent.fire(ActionTypes.RECEIVED_NOTIFICATION, notification);
};

/**
 * 触发用户信息更新事件
 * @param info
 */
module.exports.updatedUserInfo = function (info) {
  appEvent.fire(ActionTypes.UPDATED_USER_INFO, info);
};

/**
 * 出发离线事件
 * @param data
 */
module.exports.offline = function (data) {
  appEvent.fire(ActionTypes.OFFLINE, data);
};

/**
 * 触发更新客服列表事件
 * @param services
 */
module.exports.updateServices = function (services) {
  appEvent.fire(ActionTypes.UPDATED_SERVICES, services);
};
